//Controller που αναζητα ενα καταστημα.
package Controllers;

import Exceptions.DaoException;
import Interfaces.IFindStore_Dao;
import Models.FindStore;
import javax.swing.JOptionPane;

public class FindStore_Controller {

    private IFindStore_Dao x;

    public FindStore_Controller(IFindStore_Dao x) {
        this.x = x;
    }

    FindStore_Controller() {
    }

    public FindStore Validate(String StoreName) throws IllegalArgumentException, DaoException {
        if (StoreName.isEmpty()) {
            throw new IllegalArgumentException("Empty Field");
        } else {
            try {
                return x.ValidateFindStore(StoreName);
            } catch (Exception e) {
                throw e;
            }
        }
    }
}
